<?php


// Use custom admin header/footer

pref('[Loop]/views/pathToSnippetHeader.html', '/Html/Snippet.Header.html');
pref('[Loop]/views/pathToSnippetFooter.html', '/Html/Snippet.Footer.html');


// Dependencies

require_once(PATH_APPLICATION . 'Model/CAccount.php');
require_once(PATH_APPLICATION . 'Model/CPostStatus.php');


$payload = json_decode(fv('payload', true), true);

$account = new Snsfg\CAccount();

$account->loadAccount('universe', $payload['ef_universe_id'], SOCIAL_NETWORK_WEIBO);


$status = new Snsfg\CPostStatus();

$rawStatuses = $status->find
				(
					array
					(
						'conditions' =>  array 
						(
							'accountId' => array(EQUAL, $account->getInternalId()),
							'socialNetwork' => array(EQUAL, SOCIAL_NETWORK_WEIBO)
						),
						'orderBy' => array('timeOfCreation'),
						'orderDirection' => 'descendent'
					)
				);

v('rawStatuses', $rawStatuses);
v('status', $status);
v('account', $account);
?>